<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="../../angular-1.5.8/angular.js"></script>
</head>
<body>
    <!--过滤器第一种在插值语句中书写，属性加上过滤器名字-->
    <!--<div ng-app ng-init="price=123" >
        <div>{{price|currency}}</div>
    </div>-->



    <hr>
    <!--第二种在控制器里面书写-->
    <!--<div ng-app="mainApp" ng-controller="mainController">
        <div>{{price}}</div>
    </div>


    <hr>-->
    <!--时间过滤器-->
    <div ng-app="mainApp" ng-controller="mainController">
        <div>{{date}}</div>
        <div>{{newDate}}</div>
        
    </div>
</body>
<script>
    // angular.module('mainApp',[])
    //     .controller('mainController',function ($scope,$filter){
    //        var currencyFn=$filter('currency');
    //        $scope.price=currencyFn(124443); 
    //     })


    angular.module('mainApp',[])
        .controller('mainController',function ( $scope,$filter){
            var curr=new Date();
            $scope.date=curr;
            $scope.newDate=$filter('date')(curr,'hh:mm:ss dd/MM/yyyy')
        })
</script>
</html>